/*
 * mana (compiler)
 * Copyright (c) 2003 Shun Moriya <shun@mnu.sakura.ne.jp>
 *
 * The MIT License
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#if !defined(___MANA_NODE_H___)
#define ___MANA_NODE_H___

#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

#if !defined(___MANA_SYMBOL_H___)
#include "mana_symbol.h"
#endif
#if !defined(___MANA_TYPE_H___)
#include "mana_type.h"
#endif

typedef mana_node* (mana_node_event_funtion_type)(mana_node*);

extern void mana_node_initialize(void);
extern void mana_node_finalize(void);

extern void mana_node_auto_cast(mana_node*);
extern mana_node* mana_node_cast(mana_type_description*, mana_node*);
extern mana_node* mana_node_clone(mana_node*);
extern mana_node* mana_node_allocate(mana_node_type_id);
extern void mana_node_release(mana_node*);
extern mana_node* mana_node_create_leaf(char*);
extern mana_node* mana_node_create_node(mana_node_type_id, mana_node*, mana_node*);
extern mana_node* mana_node_create_member(mana_node*, char*);
extern mana_node* mana_node_create_call_member(mana_node*, char*, mana_node*);
extern mana_node* mana_node_create_function(char*);
extern mana_node* mana_node_create_digit(int);
extern mana_node* mana_node_create_real(float);
extern mana_node* mana_node_create_string(char*);
extern size_t mana_node_get_memory_size(mana_node*);

extern void mana_node_add_event(char* name, mana_node_event_funtion_type function);

#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif
